/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2008, 2009, 2010.

	This file is part of the Maxsi Library.

	Maxsi Library is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi Library is distributed in the hope that it will be useful, but
	WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
	or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
	License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Library. If not, see <http://www.gnu.org/licenses/>.

	Maxsi Library
	A powerful Cross-Platform C++ General Purpose Library that allows you to
	efficiently create high-performance and reliable applications.

	MaxsiCompress.h
	Simple functions that allows you to compress and uncompress data using
	various algorithms.

******************************************************************************/

#ifndef MaxsiCompress_H
#define MaxsiCompress_H

BeginMaxsiNamespace

//=============================================================================
//	Define where the MaxsiCompressionAlgorithm interface is declared.
//=============================================================================
#undef MAXSI_INTERFACE
#define MAXSI_INTERFACE MAXSI_INTERFACE_ABSTRACT_BASECLASS

//=============================================================================
//	Declare the MaxsiCompressionAlgorithm interface.
//=============================================================================
MAXSI_CLASSLINK MaxsiCompressionAlgorithm : public MaxsiInterface
{
	MAXSI_DECLARE_INTERFACE(MaxsiCompressionAlgorithm);

public:
	virtual size_t GetCompressedBound(size_t InSize) MAXSI_INTERFACE;
	virtual MaxsiError Compress(int Quality, BYTE* Input, size_t InputSize, BYTE* Output, size_t* OutputSize) MAXSI_INTERFACE;
	virtual MaxsiError Uncompress(BYTE* Input, size_t InputSize, BYTE* Output, size_t* OutputSize) MAXSI_INTERFACE;

};

//=============================================================================
//	Define where the MaxsiCompressionAlgorithmLZMA interface is declared.
//=============================================================================
#undef MAXSI_INTERFACE
#define MAXSI_INTERFACE MAXSI_INTERFACE_ABSTRACT_BASECLASS

//=============================================================================
//	Declare the MaxsiCompressionAlgorithmLZMA interface.
//=============================================================================
MAXSI_CLASSLINK MaxsiCompressionAlgorithmLZMA : public MaxsiCompressionAlgorithm
{
	MAXSI_DECLARE_INTERFACE(MaxsiCompressionAlgorithmLZMA);

public:
	virtual size_t GetCompressedBound(size_t InSize) MAXSI_INTERFACE;
	virtual MaxsiError Compress(int Quality, BYTE* Input, size_t InputSize, BYTE* Output, size_t* OutputSize) MAXSI_INTERFACE;
	virtual MaxsiError Uncompress(BYTE* Input, size_t InputSize, BYTE* Output, size_t* OutputSize) MAXSI_INTERFACE;

};

#ifdef Maxsi_Support_liblzma
//=============================================================================
//	Define where the MaxsiCompressionAlgorithmliblzma interface is declared.
//=============================================================================
#undef MAXSI_INTERFACE
#define MAXSI_INTERFACE MAXSI_INTERFACE_IMPLEMENTED_IN_MAXSI_LIBRARY

//=============================================================================
//	Declare the MaxsiCompressionAlgorithmliblzma interface.
//=============================================================================
MAXSI_CLASSLINK MaxsiCompressionAlgorithmliblzma : public MaxsiCompressionAlgorithmLZMA
{
	MAXSI_DECLARE_IMPLEMENTATION(MaxsiCompressionAlgorithmliblzma, MaxsiCompressionAlgorithmLZMA, MAXSI_INTERFACE_STATIC);

public:
	virtual size_t GetCompressedBound(size_t InSize) MAXSI_INTERFACE;
	virtual MaxsiError Compress(int Quality, BYTE* Input, size_t InputSize, BYTE* Output, size_t* OutputSize) MAXSI_INTERFACE;
	virtual MaxsiError Uncompress(BYTE* Input, size_t InputSize, BYTE* Output, size_t* OutputSize) MAXSI_INTERFACE;

};
#endif

EndMaxsiNamespace

#endif

